package com.graduation.sports.ui.widget;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;

import com.graduation.sports.base.BaseDialogFragment;

/**
 * @ProjectName: sports
 * @Package: com.graduation.sports.ui.widget
 * @ClassName: DialogFragmentUtil
 * @Description: java类作用描述
 * @Author: APC
 * @CreateDate: 2021/3/3 17:15
 * @Version: 1.0
 */
public class DialogFragmentUtil {
    private static final String EDIT_ADD_USER_TAG = "add_plan_dialog";


    public static BaseDialogFragment showAddSportPlanDialog(AppCompatActivity activity){
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        AddPlanDialog dialog = (AddPlanDialog) fragmentManager.findFragmentByTag(EDIT_ADD_USER_TAG);
        if (dialog == null) {
            dialog = new AddPlanDialog();
        }
        dialog.show(fragmentManager, EDIT_ADD_USER_TAG);
        return dialog;
    }
}
